In a digital image, a dynamic range is a ratio of a maximum grayscale value to a minimum grayscale value in a range in which the image can be displayed. For a natural scene in a real world, if brightness is in a range of 10−3 nits to 104 nits, a dynamic range of the real world may reach 107, and is referred to as a high dynamic range (HDR). Currently, in most color digital images, each of R, G, and B channels separately uses one 8-bit byte for storage. In other words, a representation range of each channel is a 0-255 gray scale. That is, a dynamic range of a color digital image is 0-255, and is referred to as a low dynamic range (LDR). An imaging process of a digital camera is actually mapping from the high dynamic range of the real world to the low dynamic range of the image.
A typical HDR video processing process includes: pre-processing, encoding, decoding, and post-processing. An HDR video is input, and undergoes processing performed by an optical-electro transfer function, color space transfer, floating-point-to-fixed-point conversion, 4:4:4-to-4:2:0 downsampling, and encoding performed by a 4:2:0 encoder, and a bitstream is obtained. The bitstream undergoes decoding performed by a 4:2:0 decoder, 4:2:0-to-4:4:4 upsampling, fixed-point-to-floating-point conversion, color space transfer, and processing performed by an electro-optical transfer function, and a finally output HDR video is obtained. A transfer function is used to perform non-linear transfer on an HDR source. The HDR video finally needs to be quantized to data that has an integral quantity of bits, and then is encoded. Considering that a dynamic range of the HDR video is far greater than a dynamic range of the data that has an integral quantity of bits, if linear quantization is directly performed, information of the HDR source is severely damaged. Therefore, the transfer function is mainly used to protect, through the non-linear transfer, a brightness segment that requires key protection.
A Weber score is a main indicator used to measure quantization quality of a curve. A brightness value in each interval is obtained by using the optical-electro transfer function. A smaller Weber score that is obtained through calculation after a brightness value curve in each interval is quantized indicates higher quantization quality of this brightness. If an obtained Weber score is greater than a limit value, stripe noise that a human eye can perceive appears. A primary color signal is an optical signal in the real world, may be represented by “L” or “E”, usually records a numeric value that is corresponding to a specific color component (for example, R, G, B, or Y), and is generally proportional to light intensity. A primary color signal of the image may be expressed in real brightness (for example, 10000 nits), or may be expressed in normalized brightness, for example, based on that maximum brightness 10000 nits is normalized to maximum brightness 1. Processed image information obtained after the primary color signal undergoes conversion processing is a numeric expression value of the image, and a value of the processed image information is normalized to [0,1]. The processed image information may be represented by “L′” or “E′”, which is usually used to represent a non-linear color value. Optical-electro transfer is performed on the primary color signal (normalized to [0,1]) by using the optical-electro transfer function, to obtain processed image information. The processed image information obtained through the transfer performed by the optical-electro transfer function may include primary colors such as R, G, B, and Y. Electro-optical transfer is performed on input image information by using the electro-optical transfer function, to obtain an output primary color signal. The processed output primary color signal is a restored optical signal in the real world. The optical-electro transfer function (OETF) is sometimes referred to as an optical-electro transfer function or an optical-electro transfer curve. The electro-optical transfer function (EOTF) is sometimes referred to as an electro-optical transfer function or an electro-optical transfer curve. The floating-point-to-fixed-point conversion is sometimes referred to as quantization, and the fixed-point-to-floating-point conversion is sometimes referred to as dequantization. An optical-electro transfer function in conventional scheme 1 is proposed based on a brightness perception model of a human eye. The optical-electro transfer function may be:
            R      ′        =          PQ_TF      ⁢              (                  max          ⁡                      (                          0              ,                              min                ⁡                                  (                                      R                    ⁢                                          /                                        ⁢                    10000.1                                    )                                                      )                          )                        G      ′        =          PQ_TF      ⁢              (                  max          ⁡                      (                          0              ,                              min                ⁡                                  (                                      G                    ⁢                                          /                                        ⁢                    10000.1                                    )                                                      )                          )                        B      ′        =          PQ_TF      ⁢              (                  max          ⁡                      (                          0              ,                              min                ⁡                                  (                                      B                    ⁢                                          /                                        ⁢                    10000.1                                    )                                                      )                          )                                PQ_TF        ⁢                  (          L          )                    =                        (                                                    c                1                            +                                                c                  2                                ⁢                                  L                                      m                    1                                                                                      1              +                                                c                  3                                ⁢                                  L                                      m                    1                                                                                )                          m          2                      ,                  ⁢                  where        ⁢                                  ⁢                  m          1                    =      0.1593017578125        ⁢                  ,                  ⁢                  m        2            =      78.84375        ,                  ⁢                  c        1            =      0.8359375        ⁢                  ,                  ⁢                  c        2            =      18.8515625        ⁢                  ,    and              c      3        =          18.6875      .      
A Weber score is a main indicator used to measure quantization quality of a curve. A Weber score shown in FIG. 1A is used as an example. A first curve is a Schreiber threshold in an ITU Report BT.2246 standard file. A brightness value in each interval is obtained by using the optical-electro transfer function. A smaller Weber score that is obtained through calculation after a brightness value curve in each interval is quantized indicates higher quantization quality of this brightness. If an obtained Weber score is greater than the Schreiber threshold, stripe noise that a human eye can perceive appears. A second curve includes Weber scores obtained by using the optical-electro transfer function in scheme 1. Weber scores, of the second curve, that are obtained when a brightness value is less than 0.1 nits exceed the Schreiber threshold. As a result, an output HDR image generates stripe noise that a human eye can perceive, and cannot meet a quality requirement.